<!--
 * @FilePath     : /study_code/vue2.x/component-sync.html
 * @Description  : 1s 后加载异步组件
 * @Date         : 2025-05-02 19:58:57
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-05-02 20:01:06
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="" />
  </head>
  <body>
    <div id="app">
      <h2>组件</h2>
      <async-example></async-example>
    </div>

    <script src="/vue/dist/vue.min.js"></script>
    <script src="./common.js"></script>
    <script>
      Vue.component('async-example', function (resolve, reject) {
        setTimeout(function () {
          // 向 `resolve` 回调传递组件定义
          resolve({
            template: '<div>I am async!</div>',
          })
        }, 1000)
      })
      var vm = new Vue({
        el: '#app',
        data: {
          msg: '信息',
        },
      })
    </script>
  </body>
</html>
